local single = reload("global.single")
local sqlite3 = reload("sqlite3LC")
---sqliteFactory 单例简单工厂
---:memory: 内存形式的数据库，每次启动都会重置
return function (dbName, func)
    local map = single.sqlite3 or {}
    single.sqlite3 = map
    local obj = map[dbName]
    if not obj then
        obj = sqlite3.new(dbName, {
            write = true,
            db = dbName
        })
        map[dbName] = obj

        ---初始化函数
        if func then
            func(obj)
        end
    end
    return obj
end
